﻿@model TraCuuThuatNgu.ViewModels.UserHistoryViewModel
@{
    ViewBag.Title = "Lịch sử tra cứu";
    Layout = "~/Views/Shared/_Root.cshtml";
}
@using PagedList.Mvc;
@using PagedList;

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="span span9-account">
    <div class="head">
        <div class="icm-user">
        </div>
        <h1>
            Thông tin tài khoản</h1>
        <div class="clear">
        </div>
    </div>
    <div class="block">
        <ul class="simple-menu">
            <li><a href="@Url.Content("~/Account/Info")">Thông tin tài khoản</a> </li>
            <li><a href="@Url.Content("~/Account/ChangePassword")">Đổi mật khẩu</a> </li>
            <li><a href="@Url.Content("~/AddContent")">Đóng góp của tôi</a> </li>
            <li><a href="@Url.Content("~/MyComments")">Bình luận của tôi</a> </li>
            <li class="active"><a class="active" href="@Url.Content("~/UserHistory")">Lịch sử tra cứu</a> </li>
            <li><a href="@Url.Content("~/Like")">Yêu thích</a> </li>
        </ul>
    </div>
</div>
<div class="span span8-account">
    <div class="head">
        <div class="icm-zoom">
        </div>
        <h1>
            Lịch sử tra cứu</h1>
        <div class="clear">
        </div>
    </div>
    <div class="block">
        <table cellpadding="0" cellspacing="0" width="100%" class="table">
            <thead>
                <tr>
                    <th width="50%">
                        Từ tra cứu
                    </th>
                    <th width="25%">
                        Ngày tra cứu
                    </th>
                    <th width="25%">
                        <center>Thao tác</center>
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model.AllUserHistoryPaged)
                {
                    <tr>
                        <td>
                            <span class="keyword-history"><a href="/Result?keyword=@item.Keyword">@item.Keyword</a></span>
                        </td>
                        <td>
                            @String.Format("{0:d/M/yyyy HH:mm}", item.DateAdd)
                        </td>
                        <td align="center">
                            <a class="btn-delete btn-history" title="Xóa" href="#">
                                <input type="hidden" value="@item.HistoryId" /></a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div class="view-more">
        @Html.PagedListPager((IPagedList)Model.AllUserHistoryPaged, page => Url.Action("Index", new { page = page }), new PagedListRenderOptions { LinkToFirstPageFormat = "<< Đầu tiên", LinkToPreviousPageFormat = "&larr; Trước", LinkToNextPageFormat = "Sau &rarr;", LinkToLastPageFormat = "&Uacute;Cuối >>" })
        @*@Html.PagedListPager((IPagedList)Model.AllUserHistoryPaged, page => Url.Action("Index", new { page }))*@</div>
        <div class="clear">
        </div>
    </div>
</div>
<div class="clear">
</div>
